<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/8/2
  Time: 9:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>列表图书</title>
</head>
<body>
<h1>PageContext作用域示例</h1><hr>
    <%
       List<String> books = (List<String>) pageContext.getAttribute("books");
       out.println("【pageContext作用域】:" + books);
    %>
<h1>Request作用域示例</h1><hr>
<%
       books = (List<String>) request.getAttribute("books");
        out.println("【request作用域】:" + books);
        request.removeAttribute("books");
%>
<h1>Session作用域示例</h1><hr>
<%
    books = (List<String>) session.getAttribute("books");
    out.println("【session作用域】:" + books + ",sessionID:" + session.getId());
    session.removeAttribute("books");
%>
<h1>Application作用域示例</h1><hr>
<%
    books = (List<String>) application.getAttribute("books");
    out.println("【application作用域】:" + books );
    application.removeAttribute("books");
%>
</body>
</html>
